package com.springcloud.zuul.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.springcloud.zuul.common.validator.group.AddGroup;
import com.springcloud.zuul.common.validator.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * 系统日志
 *
 */
@Data
@TableName("sys_log")
public class SysLogEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@TableId
	private String guId;
	/**
	 *日志编号
	 */
	@NotBlank(message = "日志编码不能为空！",groups = {AddGroup.class, UpdateGroup.class})
	private String logId;

	/**
	 *日志类型  1.人为操作  2.脚本操作
	 */
	@NotNull(message = "日志类型不能为空！",groups = {AddGroup.class,UpdateGroup.class})
	@Min(value = 1,message = "日志类型不符合！",groups = {AddGroup.class,UpdateGroup.class})
	@Max(value = 2,message = "日志类型不符合！",groups = {AddGroup.class,UpdateGroup.class})
	private Integer type;

	/**
	 *用户编码
	 */
	private String userId;

	/**
	 *用户名称
	 */
	private String userName;

	/**
	 *日志标题
	 */
	private String title;

	/**
	 *请求URL
	 */
	private String requestUri;

	/**
	 *请求方式
	 */
	private String method;

	/**
	 *请求参数
	 */
	private String params;
	/**
	 *执行时长(毫秒)
	 */
	private Long time;
	/**
	 *操作IP地址
	 */
	private String remoteAddr;
	/**
	 *创建时间
	 */
	private String instm;

}
